All Functions Used So Far, Week 4

mean

{base}

Get mean of a vector

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

summary

{base}

Obtain summary statistics or detailed regression output

dnorm

{stats}

Density distribution for the normal distribution

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

var

{stats}

Calculate variance

range

{base}

Return range of values

min

{base}

Get minimum of a vector

plot

{graphics}

Generic function from base R to produce a plot

glm

{base}

Fits generalized linear models

length

{base}

Returns number of elements in an object

read_excel

{readxl}

Read an Excel file

setwd

{base}

Set Working Directory

max

{base}

Get maximum of a vector

sd

{stats}

Get standard deviation of a vector

which

{base}

return indexes of TRUE entries of a logical vector

median

{stats}

Get median of a vector

expression

{base}

Used in plots to add symbols to axes

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

binomial

{base}

Family argument in glm()

par

{graphics}

Set parameters of the plotting device

ifelse

{base}

Return a or b depending on the value of test

seq

{base}

Create a sequence

as.character

{base}

Coerce a vector to character

c

{base}

Combine values/vectors into a vector

library

{base}

Load an R package

log

{base}

log (default base = e)

filter

{dplyr}

Filter out rows of a data frame according to logical vector

lm

{base}

Fit a linear model

mutate

{dplyr}

Modify/create a column in a data frame

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

rnorm

{base}

Generate random numbers from a normal distribution

list

{base}

Create a list object

sample

{base}

Takes a sample of the specified size

str

{utils}

Get the structure of an R object

data.frame

{base}

Create a data.frame from vectors

pnorm

{base}

Returns the cumulative distribution function (CDF) of the normal distribution

names

{base}

Retrieve names of a list/vector

head

{utils}

Show first 5 rows of a data frame

stargazer

{stargazer}

Create a regression output table

predict

{stats}

Predict Probability

modelsummary

{modelsummary}

Creates regression and data tables

cut

{base}

Convert Numeric to Factor

ordered

{dplyr}

Create an ordered factor

group_tt

{tinytable}

Grouping in tinytable

nobs

{gdata}

Compute the number of non-missing observations

The end!